package cn.ljy.uem.dao;

import cn.ljy.uem.model.SchoolCourse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;


/**
 * 教师负责或承担相应教学任务的接口
 * @author ljy
 * @date 2022/10/18
 */
@Mapper
public interface SchoolTeacherCourseMapper{

    /**
     * 获取指定教师负责的课程，以及承担教学任务的对应的课程
     * 说明：该课程是非删除状态
     * @param teacherId
     * @return
     */
    List<SchoolCourse> findCourseAndCourseOfTeachingtaskByTeacherId(Serializable teacherId);

    /**
     * 获取指定教师负责的课程，以及承担教学任务的对应的课程
     * 说明：该课程是非删除状态
     * @param teacherId
     * @return 返回课程数量
     */
    int countCourseAndCourseOfTeachingtaskByTeacherId(Serializable courseId, Serializable teacherId);

    /**
     * 查找课程总数
     * @param courseId
     * @param teacherId
     * @return
     */
    @Select("select count(1) from school_course where id = #{courseId} and teacher_id=#{teacherId}")
    int countByCourseIdAndTeacherId(Serializable courseId,Serializable teacherId);

    /**
     * 通过课程Id查找编辑状态
     */
//    @Select("select expired from school_course where id = #{Id}")
//    Boolean getExpireByCourseId(Long Id);
}
